// 云函数入口文件
const cloud = require('wx-server-sdk')

cloud.init()

// 云函数入口函数
exports.main = async (event, context) => {
  const openid = cloud.getWXContext().OPENID
  var {orderNum,totalPrice} = event;
  return await cloud.cloudPay.unifiedOrder({
    openid,
    body:"极蜂快送支付",
    outTradeNo:orderNum,
    spbillCreateIp:"127.0.0.1",
    subMchId:"xxxxxxx",
    totalFee : totalPrice*100,
    envId:"xxxxxxxx",
    functionName:"paotuiPay"
  })
}